<template>
    <div class="xpsf-banner">
        <div class="xpsf-ck">
            <img src="https://yanxuan.nosdn.127.net/06f32826b93c9201eb81e8ac6ecada1c.png" alt="">
            <p>查看更多></p>
        </div>
        <div class="btm">
            <div class="bx" v-for="(item, index) in data" :key="index">
                <img :src="item.imgul">
                <div class="bxtext">
                    <p>{{ item.text }}</p>
                    <span class="hb">可用红包</span><br>
                    <p class="hbc">￥{{ item.originprice }}</p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import service from '../../../../request/service.js';
export default {
    data() {
        return {
            list: {},
            data: []
        }
    },
    mounted() {
        service({
            url: "api/pro/list",
            method: "get"
        }).then(res => {
            res.data.data.forEach(element => {
                this.list = {
                    imgul: element.img1,
                    text: element.proname,
                    originprice: element.originprice
                }
                this.data.push(this.list)
            });
            console.log(res);
        });
    },
}
</script>

<style scoped>
.xpsf-banner {
    box-sizing: border-box;
    width: 95%;
    height: auto;
    /* height: 10.9375rem; */
    padding: .4375rem .625rem;
    margin: 0 auto .625rem;
    /* background-color: red; */
    border-radius: 1.25rem;
    margin: auto;

}

.xpsf-banner .xpsf-ck img {
    width: 3.875rem;
    height: 1.25rem;
}

.xpsf-banner .xpsf-ck {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.xpsf-banner .xpsf-ck p{
    font-size: .24rem;
}

.xpsf-banner .btm {
    overflow: auto;
    display: flex;
    flex-wrap: nowrap;
    margin-top: 10px;
}

.xpsf-banner .btm .bx {
    width: 25%;
    text-align: center;
    flex-shrink: 0;
    /* margin-left:7px; */

}

.xpsf-banner .btm .bx p {
    font-size: 5px;
    overflow: hidden;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}
.xpsf-banner .btm .bx .bxtext{
    display: flex;
    justify-content: space-around;
    flex-direction: column;
}

.xpsf-banner .btm img {
    width: 80px;
    height: 80px;
    border-radius: .375rem;
    margin-left: .3125rem;

}
.xpsf-banner .btm .bx .hb{
    display: block;
    background-color: #fbe7e8;
    border-radius: 20px;
    font-size: 5px;
    color: #dd1a21;
}
.xpsf-banner .btm .bx .hb .hbc{
    color: #dd1a21;
    font-size: 5px;
}
</style>